home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 2002 November
/
SGI Freeware 2002 November - Disc 1.iso
/
dist
/
fw_exif.idb
/
usr
/
freeware
/
src
/
exif
/
patches.z
/
patches
Wrap
Text File
|
2002-10-07
|
13KB
|
405 lines
--- ./exif/main.c Thu Jul 25 11:53:32 2002
+++ ../exif-0.5/./exif/main.c Tue Sep 24 11:53:00 2002
@@ -20,6 +20,7 @@
#include <config.h>
+#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -165,44 +166,42 @@
typedef struct _ExifOptions ExifOptions;
struct _ExifOptions {
- unsigned char use_ids;
- ExifTag tag;
+ unsigned int use_ids;
+ ExifTag tag;
};
+static ExifOptions eo = {0, 0};
+static unsigned int extract_thumbnail = 0;
+static const char *ifd_string = NULL;
+static const char *ithumbnail = NULL;
+static unsigned int list_tags = 0;
+static const char *output = NULL;
+static const char *set_value = NULL;
+static unsigned int show_description = 0;
+static const char *tag_string = NULL;
+
+static struct poptOption options[] = {
+POPT_AUTOHELP
+{ "ids", 'i', POPT_ARG_NONE, &eo.use_ids, 0, N_("Show IDs instead of tag names"), NULL },
+{ "tag", 't', POPT_ARG_STRING, &tag_string, 0, N_("Select tag"), N_("tag") },
+{ "ifd", '\0', POPT_ARG_STRING, &ifd_string, 0, N_("Select IFD"), N_("IFD") },
+{ "list-tags", 'l', POPT_ARG_NONE, &list_tags, 0, N_("List all EXIF tags"), NULL },
+{ "show-description", 's', POPT_ARG_NONE, &show_description, 0, N_("Show description of tag"), NULL },
+{ "extract-thumbnail", 'e', POPT_ARG_NONE, &extract_thumbnail, 0, N_("Extract thumbnail"), NULL },
+{ "insert-thumbnail", 'n', POPT_ARG_STRING, &ithumbnail, 0, N_("Insert FILE as thumbnail"), N_("FILE") },
+{ "output", 'o', POPT_ARG_STRING, &output, 0, N_("Write output to FILE"), N_("FILE") },
+{ "set-value", '\0', POPT_ARG_STRING, &set_value, 0, N_("Value"), NULL },
+POPT_TABLEEND
+};
+
int
main (int argc, const char **argv)
{
/* POPT_ARG_NONE needs an int, not char! */
- unsigned int list_tags = 0, show_description = 0;
- unsigned int extract_thumbnail = 0;
- const char *set_value = NULL, *ifd_string = NULL, *tag_string = NULL;
ExifIfd ifd = -1;
ExifTag tag = 0;
- ExifOptions eo = {0, 0};
poptContext ctx;
- const char **args, *output = NULL;
- const char *ithumbnail = NULL;
- struct poptOption options[] = {
- POPT_AUTOHELP
- {"ids", 'i', POPT_ARG_NONE, &eo.use_ids, 0,
- N_("Show IDs instead of tag names"), NULL},
- {"tag", 't', POPT_ARG_STRING, &tag_string, 0,
- N_("Select tag"), N_("tag")},
- {"ifd", '\0', POPT_ARG_STRING, &ifd_string, 0,
- N_("Select IFD"), N_("IFD")},
- {"list-tags", 'l', POPT_ARG_NONE, &list_tags, 0,
- N_("List all EXIF tags"), NULL},
- {"show-description", 's', POPT_ARG_NONE, &show_description, 0,
- N_("Show description of tag"), NULL},
- {"extract-thumbnail", 'e', POPT_ARG_NONE, &extract_thumbnail, 0,
- N_("Extract thumbnail"), NULL},
- {"insert-thumbnail", 'n', POPT_ARG_STRING, &ithumbnail, 0,
- N_("Insert FILE as thumbnail"), N_("FILE")},
- {"output", 'o', POPT_ARG_STRING, &output, 0,
- N_("Write output to FILE"), N_("FILE")},
- {"set-value", '\0', POPT_ARG_STRING, &set_value, 0,
- N_("Value"), NULL},
- POPT_TABLEEND};
+ const char **args;
ExifData *ed;
ExifEntry *e;
char fname[1024];
@@ -317,9 +316,15 @@
/* Save the thumbnail */
f = fopen (fname, "wb");
if (!f) {
+#ifdef __GNUC__
fprintf (stderr,
_("Could not open '%s' for "
"writing (%m)!"), fname);
+#else
+ fprintf (stderr,
+ _("Could not open '%s' for "
+ "writing (%s)!"), fname, strerror(errno));
+#endif
fprintf (stderr, "\n");
return (1);
}
@@ -340,8 +345,13 @@
f = fopen (ithumbnail, "rb");
if (!f) {
+#ifdef __GNUC__
fprintf (stderr, _("Could not open "
"'%s' (%m)!"), ithumbnail);
+#else
+ fprintf (stderr, _("Could not open "
+ "'%s' (%s)!"), ithumbnail, strerror(errno));
+#endif
fprintf (stderr, "\n");
return (1);
}
@@ -358,8 +368,13 @@
fseek (f, 0, SEEK_SET);
if (fread (ed->data, sizeof (char),
ed->size, f) != ed->size) {
+#ifdef __GNUC__
fprintf (stderr, _("Could not read "
"'%s' (%m)."), ithumbnail);
+#else
+ fprintf (stderr, _("Could not read "
+ "'%s' (%s)."), ithumbnail, strerror(errno));
+#endif
fprintf (stderr, "\n");
return (1);
}
--- ./exif/Makefile.in Thu Jul 25 12:37:46 2002
+++ ../exif-0.5/./exif/Makefile.in Thu Oct 3 15:37:42 2002
@@ -106,7 +106,7 @@
exif_SOURCES = actions.h actions.c main.c utils.h utils.c
-exif_LDADD = ../libjpeg/libjpeg.la -lpopt $(LIBEXIF_LIBS)
+exif_LDADD = ../libjpeg/libjpeg.a -lpopt $(LIBEXIF_LIBS)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
@@ -118,9 +118,9 @@
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
+LIBS = @LIBS@ $(INTLLIBS)
exif_OBJECTS = actions.$(OBJEXT) main.$(OBJEXT) utils.$(OBJEXT)
-exif_DEPENDENCIES = ../libjpeg/libjpeg.la
+exif_DEPENDENCIES = ../libjpeg/libjpeg.a
exif_LDFLAGS =
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
--- ./exif/actions.c Thu Jul 25 08:45:13 2002
+++ ../exif-0.5/./exif/actions.c Tue Sep 24 11:53:00 2002
@@ -62,7 +62,7 @@
printf ("%-38.38s", txt);
for (i = 0; i < EXIF_IFD_COUNT; i++)
printf ("%-7.7s", exif_ifd_get_name (i));
- printf ("\n");
+ putchar ('\n');
for (tag = 0; tag < 0xffff; tag++) {
name = exif_tag_get_title (tag);
if (!name)
@@ -73,7 +73,7 @@
printf (ENTRY_FOUND);
else
printf (ENTRY_NOT_FOUND);
- printf ("\n");
+ putchar ('\n');
}
}
@@ -86,12 +86,12 @@
printf ("0x%04x", entry->tag);
else
printf ("%-20.20s", exif_tag_get_title (entry->tag));
- printf ("|");
+ putchar ('|');
if (*ids)
- printf ("%-73.73s", exif_entry_get_value (entry));
+ printf ("%-72.72s", exif_entry_get_value (entry));
else
- printf ("%-59.59s", exif_entry_get_value (entry));
- printf ("\n");
+ printf ("%-58.58s", exif_entry_get_value (entry));
+ putchar ('\n');
}
static void
@@ -107,11 +107,11 @@
width = (ids ? 6 : 20);
for (i = 0; i < width; i++)
- printf ("-");
- printf ("+");
- for (i = 0; i < 79 - width; i++)
- printf ("-");
- printf ("\n");
+ putchar ('-');
+ putchar ('+');
+ for (i = 0; i < 78 - width; i++)
+ putchar ('-');
+ putchar ('\n');
}
void
@@ -125,18 +125,18 @@
order = exif_data_get_byte_order (ed);
printf (_("EXIF tags in '%s' ('%s' byte order):"), filename,
exif_byte_order_get_name (order));
- printf ("\n");
+ putchar ('\n');
print_hline (ids);
if (ids)
printf ("%-6.6s", _("Tag"));
else
printf ("%-20.20s", _("Tag"));
- printf ("|");
+ putchar ('|');
if (ids)
- printf ("%-73.73s", _("Value"));
+ printf ("%-72.72s", _("Value"));
else
- printf ("%-59.59s", _("Value"));
- printf ("\n");
+ printf ("%-58.58s", _("Value"));
+ putchar ('\n');
print_hline (ids);
exif_data_foreach_content (ed, show_ifd, &ids);
print_hline (ids);
@@ -143,6 +143,6 @@
if (ed->size) {
printf (_("EXIF data contains a thumbnail (%i bytes)."),
ed->size);
- printf ("\n");
+ putchar ('\n');
}
}
--- ./libjpeg/Makefile.in Thu Jul 25 12:37:44 2002
+++ ../exif-0.5/./libjpeg/Makefile.in Thu Oct 3 15:35:52 2002
@@ -102,14 +102,14 @@
INCLUDES = -I$(top_srcdir) $(LIBEXIF_CFLAGS)
-noinst_LTLIBRARIES = libjpeg.la
-libjpeg_la_SOURCES = jpeg-data.c jpeg-data.h jpeg-marker.c jpeg-marker.h
+noinst_LIBRARIES = libjpeg.a
+libjpeg_a_SOURCES = jpeg-data.c jpeg-data.h jpeg-marker.c jpeg-marker.h
-libjpeg_la_LIBADD = $(LIBEXIF_LIBS)
+libjpeg_a_LIBADD =
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
+LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
@@ -116,9 +116,9 @@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-libjpeg_la_LDFLAGS =
-libjpeg_la_DEPENDENCIES =
-libjpeg_la_OBJECTS = jpeg-data.lo jpeg-marker.lo
+libjpeg_a_LDFLAGS =
+libjpeg_a_DEPENDENCIES =
+libjpeg_a_OBJECTS = jpeg-data.o jpeg-marker.o
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@@ -130,8 +130,8 @@
TAR = tar
GZIP_ENV = --best
-SOURCES = $(libjpeg_la_SOURCES)
-OBJECTS = $(libjpeg_la_OBJECTS)
+SOURCES = $(libjpeg_a_SOURCES)
+OBJECTS = $(libjpeg_a_OBJECTS)
all: all-redirect
.SUFFIXES:
@@ -144,14 +144,14 @@
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-mostlyclean-noinstLTLIBRARIES:
+mostlyclean-noinstLIBRARIES:
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-distclean-noinstLTLIBRARIES:
+distclean-noinstLIBRARIES:
-maintainer-clean-noinstLTLIBRARIES:
+maintainer-clean-noinstLIBRARIES:
.c.o:
$(COMPILE) -c $<
@@ -188,7 +188,7 @@
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
mostlyclean-libtool:
- -rm -f *.lo
+ -rm -f *.lo *.o
clean-libtool:
-rm -rf .libs _libs
@@ -197,8 +197,8 @@
maintainer-clean-libtool:
-libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES)
- $(LINK) $(libjpeg_la_LDFLAGS) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)
+libjpeg.a: $(libjpeg_a_OBJECTS) $(libjpeg_a_DEPENDENCIES)
+ $(LINK) $(libjpeg_a_LDFLAGS) $(libjpeg_a_OBJECTS) $(libjpeg_a_LIBADD) $(LIBS)
tags: TAGS
@@ -267,7 +267,7 @@
install: install-am
uninstall-am:
uninstall: uninstall-am
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile $(LIBRARIES)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
@@ -283,18 +283,18 @@
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \
+mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-tags \
mostlyclean-generic
mostlyclean: mostlyclean-am
-clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \
+clean-am: clean-noinstLIBRARIES clean-compile clean-libtool \
clean-tags clean-generic mostlyclean-am
clean: clean-am
-distclean-am: distclean-noinstLTLIBRARIES distclean-compile \
+distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-libtool distclean-tags distclean-generic \
clean-am
-rm -f libtool
@@ -301,7 +301,7 @@
distclean: distclean-am
-maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \
+maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-tags maintainer-clean-generic \
distclean-am
@@ -310,8 +310,8 @@
maintainer-clean: maintainer-clean-am
-.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \
-clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \
+.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
--- ./configure.in Thu Jul 25 12:29:19 2002
+++ ../exif-0.5/./configure.in Tue Sep 24 11:53:00 2002
@@ -19,7 +19,7 @@
AC_SUBST(LIBEXIF_LIBS)
AC_SUBST(LIBEXIF_CFLAGS)
-CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Werror"
+#CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Werror"
AC_SUBST(CFLAGS)
AC_OUTPUT([
--- ./ltmain.sh Tue Jul 2 13:12:16 2002
+++ ../exif-0.5/./ltmain.sh Tue Sep 24 11:53:48 2002
@@ -61,7 +61,7 @@
default_mode=
help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
+mkdir="mkdir -p"
mv="mv -f"
rm="rm -f"
--- ./configure Thu Jul 25 12:36:06 2002
+++ ../exif-0.5/./configure Thu Oct 3 15:48:42 2002
@@ -9795,7 +9795,7 @@
-CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Werror"
+#CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Werror"
ac_config_files="$ac_config_files Makefile libjpeg/Makefile exif/Makefile intl/Makefile po/Makefile.in"